package com.senney.practice.spring.aop;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAspect {

    @Pointcut("execution(* com.senney.practice.spring.aop..*.*(..))")
    private void myPointCut(){

    }

    @Before(value="myPointCut()")
    public void before(){
        System.out.println("before...");
    }

    @After(value="myPointCut()")
    public void after(){
        System.out.println("after...");
    }

    @AfterReturning(value="myPointCut()")
    public void afterReturning(){
        System.out.println("afterReturning...");
    }

    @AfterThrowing(value="myPointCut()")
    public void afterThrowing(){
        System.out.println("afterThrowing...");
    }
}
